from django.db import models
class Yonghu(models.Model):#用户
    username=models.CharField(max_length=20)
    user_level=models.IntegerField()
class Libary(models.Model):#商品表
    title=models.CharField(max_length=20)
    price=models.IntegerField()
    cate=models.ForeignKey(Yonghu,on_delete=models.CASCADE)
class you(models.Model):
    price=models.IntegerField()
    uid = models.ForeignKey(Yonghu, on_delete=models.CASCADE)
class Che(models.Model):#购物车
    uid=models.ForeignKey(Yonghu,on_delete=models.SET_NULL,null=True)
    pid=models.ForeignKey(Libary,on_delete=models.SET_NULL,null=True)
    num=models.SmallIntegerField()
    select=models.BooleanField(default=False)#复选框

